﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI;
using System.Web;
namespace Doan_ver1
{
   public  class Alert
    {
       public static void Show(string msg)
       {
           string cleanMsg = msg.Replace("'", "\'");
           string script =
               "<script type=\"text/javascript\">alert('" +
               cleanMsg + "');</script>";
           Page p = HttpContext.Current.CurrentHandler as Page;

           if (p != null &&
               !p.ClientScript.IsClientScriptBlockRegistered("alert"))
           {
               p.ClientScript.RegisterClientScriptBlock(
                   typeof(Alert), "alert", script
               );
           }
       }
    }
}
